//
// DirectionSpecificStreamParameters.hpp for DirectionSpecificStreamParameters in /home/mambou_j//babel-2014
// 
// Made by jacquesquentin mamboumouafo
// Login   <mambou_j@epitech.net>
// 
// Started on  Mon May 14 15:55:39 2012 jacquesquentin mamboumouafo
// Last update Tue May 15 17:11:42 2012 jacquesquentin mamboumouafo
//


#ifndef	__DIRECTIONSPECIFICSTREAMPARAMETERS_HPP__
#define	__DIRECTIONSPECIFICSTREAMPARAMETERS_HPP__

#include	<cstddef>
#include	"portaudio.h"
#include	"System.hpp"
#include	"SampleDataFormat.hpp"


// Forward declaration(s):
namespace	portaudio
{
  class Device;
}

// Declaration(s):
namespace	portaudio
{

  /////
  /// @brief All parameters for one direction (either in or out) of a stream.
  /// Together with parameters common to both directions, two DirectionSpecific
  /// StreamParameters can make up a StreamParameters object which contains all
  /// parameters for a Stream.
  /////
	class	DirectionSpecificStreamParameters
	{
	public:
	  static	DirectionSpecificStreamParameters null();

	  DirectionSpecificStreamParameters();
	  DirectionSpecificStreamParameters(const Device &device, int numChannels, SampleDataFormat Format, bool interleaved, PaTime suggestedLatency, void *hostApiSpecificStreamInfo);

	  // Set up methods:
	  void	setDevice(const Device &device);
	  void	setNumChannels(int numChannels);

	  void	setSampleFormat(SampleDataFormat format, bool interleaved = true);
	  void	setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved = true);

	  void	setSuggestedLatency(PaTime Latency);

	  void	setHostApiSpecificStreamInfo(void *streamInfo);

	  // Accessor methods:
	  PaStreamParameters	*paStreamParameters();
	  const	PaStreamParameters	*paStreamParameters() const;

	  Device	&device() const;
	  int	numChannels() const;

	  SampleDataFormat	sampleFormat() const;
	  bool	isSampleFormatInterleaved() const;
	  bool	isSampleFormatHostApiSpecific() const;
	  PaSampleFormat	hostApiSpecificSampleFormat() const;

	  PaTime	suggestedLatency() const;

	  void	*hostApiSpecificStreamInfo() const;

	private:
	  PaStreamParameters	paStreamParameters_;
	};
}

#endif
